<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>添加附件类型</title>
	<meta name="decorator" content="ani"/>
	<style>
		.select-disabled {
			pointer-events: none;
			background-color: #eeeeee;
		}
	</style>
	<script type="text/javascript">
        function save() {
            var isValidate = jp.validateForm('#inputForm');//校验表单
            if(!isValidate){
				jp.error("必填项不能为空，请检查！");
                return false;
            }else{
                jp.loading();
                jp.post("${ctx}/sys/stockRule/save",$('#inputForm').serialize(),function(data){
                    if(data.success){
                        jp.getParent().refreshDictValue();
                        var dialogIndex = parent.layer.getFrameIndex(window.name); // 获取窗口索引
                        parent.layer.close(dialogIndex);
                        jp.success(data.msg)

                    }else{
                        jp.error(data.msg);
                    }
                })
            }

        }
	</script>
</head>
<div class="wrapper wrapper-content">
	<div class="row">
		<div class="col-md-12">
			<div class="panel panel-primary">
				<div class="panel-body">
					<form:form id="inputForm" modelAttribute="stockRule" action="${ctx}/sys/stockRule/save" method="post" class="form-horizontal">
					<form:hidden path="id"/>
					<form:hidden path="object"/>
						<div class="form-group">
							<label class="col-sm-2 col-md-1 control-label">取数规则：</label>
							<div class="col-sm-10 col-md-11">
								<form:select path="datarule" multiple="multiple" size="5" class="form-control ">
									<form:option value="" label=""/>
									<form:options items="${fns:getDictList('Sys_StockStatus')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
								</form:select>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 col-md-1 control-label"><font color="red">目标规则：</font></label>
							<div class="col-sm-10 col-md-11">
								<form:select path="stockrule"  class="form-control ">
									<form:option value="" label=""/>
									<form:options items="${fns:getDictList('Sys_StockStatus')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
								</form:select>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 col-md-1 control-label"><font color="red">状态类别：</font></label>
							<div class="col-sm-10 col-md-11">
								<form:select path="stockRuleType"  class="form-control ">
									<form:option value="" label=""/>
									<form:options items="${fns:getDictList('Sys_StockRuleType')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
								</form:select>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 col-md-1 control-label"><font color="red">启用：</font></label>
							<div class="col-sm-10 col-md-11">
								<form:select path="state" class="form-control ">
									<form:option value="" label=""/>
									<form:options items="${fns:getDictList('Sys_YesNo')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
								</form:select>
							</div>
						</div>
					</form:form>
				</div>
			</div>
		</div>
	</div>
</div>
</body>
</html>
